import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.awt.event.ActionEvent;

import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

public class SliderGUI extends JFrame 
{
  JPanel pane=new JPanel(new GridBagLayout());
  GridBagConstraints c = new GridBagConstraints();
  JSlider slider = new JSlider();
  JSlider slider1 = new JSlider();
  JSlider slider2 = new JSlider();
  JSlider slider3 = new JSlider();
  JLabel label1 = new JLabel();

  
  SliderGUI() 
  {
    super("Slider GUI"); 
    setBounds(0,300,600,300);
    super.setResizable(false);
    setDefaultCloseOperation(HIDE_ON_CLOSE);
    Container con=this.getContentPane(); // inherit main frame
    con.add(pane); // add the panel to frame
    
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 0.5;
    c.gridx = 0;
    c.gridy = 0;
    c.insets = new Insets(10,30,0,0) ;
    slider.setBorder(BorderFactory.createTitledBorder(""));
    slider.setOrientation(JSlider.VERTICAL);
//    slider.setValue(0);
    pane.add(slider,c);

    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 0.5;
    c.gridx = 1;
    c.gridy = 0;
    c.insets = new Insets(10,10,0,30) ;
    slider1.setBorder(BorderFactory.createTitledBorder(""));
    slider1.setOrientation(JSlider.VERTICAL);
    pane.add(slider1,c);
    
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 0.5;
    c.gridx = 2;
    c.gridy = 0;
    c.insets = new Insets(10,10,0,30) ;
    slider2.setBorder(BorderFactory.createTitledBorder(""));
    slider2.setOrientation(JSlider.VERTICAL);
    pane.add(slider2,c);
    
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 0.5;
    c.gridx = 3;
    c.gridy = 0;
    c.insets = new Insets(10,10,0,30) ;
    slider3.setBorder(BorderFactory.createTitledBorder(""));
    slider3.setOrientation(JSlider.VERTICAL);
    pane.add(slider3,c);

    slider.addChangeListener(new LSlider());
    slider1.addChangeListener(new LSlider1());
    slider2.addChangeListener(new LSlider2());
    slider3.addChangeListener(new LSlider3());
    this.setVisible(true);
  }
//  public class lSlider implements ChangeListener{
//
//	@Override
//	public void stateChanged(ChangeEvent e) {
//		// TODO Auto-generated method stub
//		
//	}
//	  
//  }


  public class LSlider implements ChangeListener{
	    public void stateChanged(ChangeEvent ce){
	      int value = slider.getValue();
	      System.out.println(value);
	      Main.improvise.styleStrengths[0]=value;
	    }
  }
  public class LSlider1 implements ChangeListener{
	    public void stateChanged(ChangeEvent ce){
	      int value = slider1.getValue();
	      System.out.println(value);
	      Main.improvise.styleStrengths[1]=value;
	    }
  }
  public class LSlider2 implements ChangeListener{
	    public void stateChanged(ChangeEvent ce){
	      int value = slider2.getValue();
	      System.out.println(value);
	      Main.improvise.styleStrengths[2]=value;
	    }
}
public class LSlider3 implements ChangeListener{
	    public void stateChanged(ChangeEvent ce){
	      int value = slider3.getValue();
	      System.out.println(value);
	      Main.improvise.styleStrengths[3]=value;
	    }
}
 
}